home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 26 / AMIGAplus Sonderheft 26 (2000)(Falke)(DE)(Track 1 of 2)[!].iso / Tools / Packer / xad / Developer / Include / C / libraries / xadmaster.h
C/C++ Source or Header  |  1999-03-29  |  20KB  |  463 lines

  1. #ifndef LIBRARIES_XADMASTER_H
  2. #define LIBRARIES_XADMASTER_H
  3.  
  4. /*
  5. **    $VER: xadmaster.h 1.1 (11.11.1998)
  6. **    xadmaster.library defines and structures
  7. **
  8. **    Copyright © 1998 by Dirk Stöcker
  9. **    All Rights Reserved.
  10. */
  11.  
  12. #ifndef EXEC_LIBRARIES_H
  13. #include <exec/libraries.h>
  14. #endif
  15.  
  16. #ifndef UTILITY_TAGITEM_H
  17. #include <utility/tagitem.h>
  18. #endif
  19.  
  20. /************************************************************************
  21. *                                                *
  22. *    library base structure                        *
  23. *                                                *
  24. ************************************************************************/
  25.  
  26. struct xadMasterBase {
  27.   struct Library       xmb_LibNode;
  28.   struct ExecBase *    xmb_SysBase;
  29.   struct DosLibrary *  xmb_DOSBase;
  30.   struct UtilityBase * xmb_UtilityBase;
  31.   ULONG               xmb_RecogSize;    /* read only */
  32. };
  33.  
  34. /************************************************************************
  35. *                                                *
  36. *    tag-function call flags                               *
  37. *                                                *
  38. ************************************************************************/
  39.  
  40. /* input tags for xadGetInfo, only one can be specified per call */
  41. #define XAD_INSIZE        (TAG_USER+  1) /* input data size */
  42. #define XAD_INFILENAME        (TAG_USER+  2)
  43. #define XAD_INFILEHANDLE    (TAG_USER+  3)
  44. #define XAD_INMEMORY        (TAG_USER+  4)
  45. #define XAD_INHOOK        (TAG_USER+  5)
  46.  
  47. /* output tags, only one can be specified per call, xadXXXXUnArc */
  48. #define XAD_OUTSIZE        (TAG_USER+ 10) /* output data size */
  49. #define XAD_OUTFILENAME        (TAG_USER+ 11)
  50. #define XAD_OUTFILEHANDLE    (TAG_USER+ 12)
  51. #define XAD_OUTMEMORY        (TAG_USER+ 13)
  52. #define XAD_OUTHOOK        (TAG_USER+ 14)
  53. #define XAD_OUTDEVICE        (TAG_USER+ 15) /* for disk archives only */
  54.  
  55. /* object allocation tags for xadAllocObjectA */
  56. #define XAD_OBJNAMESIZE        (TAG_USER+ 20) /* XADOBJ_FILEINFO, size of needed name space */
  57. #define XAD_OBJCOMMENTSIZE    (TAG_USER+ 21) /* XADOBJ_FILEINFO, size of needed comment space */
  58. #define XAD_OBJPRIVINFOSIZE    (TAG_USER+ 22) /* XADOBJ_FILEINFO & XADOBJ_DISKINOF, self use size */
  59. #define XAD_OBJBLOCKENTRIES    (TAG_USER+ 23) /* XADOBJ_DISKINFO, number of needed entries */
  60.  
  61. /* tags for xadGetInfo, xadFileUnArc and xadDiskUnArc */
  62. #define XAD_NOEXTERN        (TAG_USER+ 50) /* do not use extern clients */
  63. #define XAD_PASSWORD        (TAG_USER+ 51) /* password when needed */
  64. #define XAD_ENTRYNUMBER        (TAG_USER+ 52) /* number of wanted entry */
  65. #define XAD_PROGRESSHOOK    (TAG_USER+ 53) /* the progress hook */
  66. #define XAD_OVERWRITE        (TAG_USER+ 54) /* overwrite file ? */
  67. #define XAD_MAKEDIRECTORY    (TAG_USER+ 55) /* create directory tree */
  68. #define XAD_IGNOREGEOMETRY    (TAG_USER+ 56) /* ignore drive geometry ? */
  69. #define XAD_LOWCYLINDER        (TAG_USER+ 57) /* lowest cylinder */
  70. #define XAD_HIGHCYLINDER    (TAG_USER+ 58) /* highest cylinder */
  71.  
  72. /* input tags for xadConvertDates, only one can be passed */
  73. #define XAD_DATEUNIXUTC        (TAG_USER+ 70) /* unix date variable */
  74. #define XAD_DATEAMIGA        (TAG_USER+ 71) /* amiga date variable */
  75. #define XAD_DATEDATESTAMP    (TAG_USER+ 72) /* struct DateStamp */
  76. #define XAD_DATEXADDATE        (TAG_USER+ 73) /* struct xadDate */
  77. #define XAD_DATECLOCKDATA    (TAG_USER+ 74) /* struct ClockData */
  78. #define XAD_DATECURRENTTIME    (TAG_USER+ 75) /* input is system time */
  79.  
  80. /* output tags, there can be specified multiple tags for one call */
  81. #define XAD_GETDATEUNIXUTC    (TAG_USER+ 80) /* unix date variable */
  82. #define XAD_GETDATEAMIGA    (TAG_USER+ 81) /* amiga date variable */
  83. #define XAD_GETDATEDATESTAMP    (TAG_USER+ 82) /* struct DateStamp */
  84. #define XAD_GETDATEXADDATE    (TAG_USER+ 83) /* struct xadDate */
  85. #define XAD_GETDATECLOCKDATA    (TAG_USER+ 84) /* struct ClockData */
  86.  
  87. /************************************************************************
  88. *                                                *
  89. *    objects for xadAllocObjectA                           *
  90. *                                                *
  91. ************************************************************************/
  92.  
  93. #define XADOBJ_ARCHIVEINFO    0x0001 /* struct xadArchiveInfo */
  94. #define XADOBJ_FILEINFO        0x0002 /* struct xadFileInfo */
  95. #define XADOBJ_DISKINFO        0x0003 /* struct xadDiskInfo */
  96. #define XADOBJ_HOOKPARAM    0x0004 /* struct HookParam */
  97. #define XADOBJ_DEVICEINFO    0x0005 /* struct xadDeviceInfo */
  98. #define XADOBJ_PROGRESSINFO    0x0006 /* struct xadProgressInfo */
  99.  
  100. /************************************************************************
  101. *                                                *
  102. *    hook related stuff                                *
  103. *                                                *
  104. ************************************************************************/
  105.  
  106. #define XADHC_READ    1    /* read data into buffer */
  107. #define XADHC_WRITE    2    /* write buffer data to file/memory */
  108. #define XADHC_SEEK    3    /* seek in file */
  109. #define XADHC_INIT    4    /* initialize the hook */
  110. #define XADHC_FREE    5    /* end up hook work, free stuff */
  111. #define XADHC_ABORT    6    /* an error occured, delete partial stuff */
  112. #define XADHC_FULLSIZE    7    /* complete input size is needed */
  113.  
  114. struct xadHookParam {
  115.   ULONG xhp_Command;
  116.   ULONG xhp_CommandData;
  117.   APTR  xhp_BufferPtr;
  118.   LONG  xhp_BufferSize;
  119.   LONG  xhp_DataPos;        /* current seek position */
  120.   APTR  xhp_PrivatePtr;
  121. };
  122.  
  123. /* xadHookAccess commands */
  124. #define XADAC_READ        10    /* get data */
  125. #define    XADAC_WRITE        11    /* write data */
  126. #define XADAC_COPY        12    /* copy input to ouput */
  127. #define XADAC_INPUTSEEK        13    /* seek in input file */
  128. #define XADAC_OUTPUTSEEK    14    /* seek in output file */
  129.  
  130. /************************************************************************
  131. *                                                *
  132. *    support structures                              *
  133. *                                                *
  134. ************************************************************************/
  135.  
  136. /* Own date structure to cover all possible dates in a human friendly
  137.    format. xadConvertDates may be used to convert between different date
  138.    structures and variables. */
  139. struct xadDate {
  140.   ULONG xd_Micros;    /* values 0 to 999999     */
  141.   LONG  xd_Year;    /* values 1 to 2147483648 */
  142.   UBYTE xd_Month;    /* values 1 to 12         */
  143.   UBYTE xd_WeekDay;    /* values 1 to 7          */
  144.   UBYTE xd_Day;        /* values 1 to 31         */
  145.   UBYTE xd_Hour;    /* values 0 to 23         */
  146.   UBYTE xd_Minute;    /* values 0 to 60         */
  147.   UBYTE xd_Second;    /* values 0 to 60         */
  148. };
  149.  
  150. #define XADDAY_MONDAY        1    /* monday is the first day and */
  151. #define XADDAY_TUESDAY        2
  152. #define XADDAY_WEDNESDAY    3
  153. #define XADDAY_THURSDAY        4
  154. #define XADDAY_FRIDAY        5
  155. #define XADDAY_SATURDAY     6
  156. #define XADDAY_SUNDAY        7    /* sunday the last day of a week */
  157.  
  158. struct xadDeviceInfo { /* for XAD_OUTDEVICE tag */
  159.   STRPTR xdi_DeviceName; /* name of device */
  160.   ULONG  xdi_Unit;     /* unit of device */
  161.   STRPTR xdi_DOSName;     /* instead of Device+Unit, dos name without ':' */
  162. };
  163.  
  164. /************************************************************************
  165. *                                                *
  166. *    information structures                              *
  167. *                                                *
  168. ************************************************************************/
  169.  
  170. struct xadArchiveInfo {
  171.   struct xadClient *   xai_Client;   /* pointer to unarchiving client */
  172.   APTR               xai_PrivateClient; /* private client data */
  173.   STRPTR           xai_Password; /* password for crypted archives */
  174.   ULONG               xai_Flags;    /* read only XADAIF_ flags */
  175.   ULONG               xai_LowCyl;   /* lowest cylinder to unarchive */
  176.   ULONG               xai_HighCyl;  /* highest cylinder to unarchive */
  177.   ULONG               xai_InPos;    /* input position, read only */
  178.   ULONG               xai_InSize;   /* input size, read only */
  179.   ULONG               xai_OutPos;   /* output position, read only */
  180.   ULONG               xai_OutSize;  /* output file size, read only */
  181.   struct xadFileInfo * xai_FileInfo; /* data pointer for file arcs */
  182.   struct xadDiskInfo * xai_DiskInfo; /* data pointer for disk arcs */
  183.   struct xadFileInfo * xai_CurFile;  /* data pointer for current file arc */
  184.   struct xadDiskInfo * xai_CurDisk;  /* data pointer for current disk arc */
  185. };
  186. /* This structure is nearly complete private to either xadmaster or its
  187. clients. An application program may access for reading only xai_Client,
  188. xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  189. is useful. All the other stuff is private and should not be accessed! */
  190.  
  191. #define XADAIB_CRYPTED        0 /* archive entries are encrypted */
  192. #define XADAIB_FILECORRUPT    1 /* file is corrupt, but valid entries are in the list */
  193. #define XADAIB_FILEARCHIVE    2 /* unarchive file entry */
  194. #define XADAIB_DISKARCHIVE    3 /* unarchive disk entry */
  195. #define XADAIB_OVERWRITE    4 /* overwrite the file */
  196. #define XADAIB_MAKEDIRECTORY    5 /* create directory when missing */
  197. #define XADAIB_IGNOREGEOMETRY    6 /* ignore drive geometry */
  198.  
  199. #define XADAIF_CRYPTED        (1<<XADAIB_CRYPTED)
  200. #define XADAIF_FILECORRUPT    (1<<XADAIB_FILECORRUPT)
  201. #define XADAIF_FILEARCHIVE    (1<<XADAIB_FILEARCHIVE)
  202. #define XADAIF_DISKARCHIVE    (1<<XADAIB_DISKARCHIVE)
  203. #define XADAIF_OVERWRITE    (1<<XADAIB_OVERWRITE)
  204. #define XADAIF_MAKEDIRECTORY    (1<<XADAIB_MAKEDIRECTORY)
  205. #define XADAIF_IGNOREGEOMETRY    (1<<XADAIB_IGNOREGEOMETRY)
  206.  
  207. struct xadFileInfo {
  208.   struct xadFileInfo * xfi_Next;
  209.   ULONG               xfi_EntryNumber;/* number of entry, starts with 1 */
  210.   STRPTR           xfi_EntryInfo;  /* additional archiver text */
  211.   APTR               xfi_PrivateInfo;/* client private, see XAD_OBJPRIVINFOSIZE */
  212.   ULONG               xfi_Flags;      /* see XADFIF_xxx defines */
  213.   STRPTR           xfi_FileName;   /* see XAD_OBJNAMESIZE tag */
  214.   STRPTR           xfi_Comment;    /* see XAD_OBJCOMMENTSIZE tag */
  215.   ULONG             xfi_Protection; /* OS 3 bits (including multiuser) */
  216.   ULONG               xfi_OwnerUID;   /* user ID */
  217.   ULONG               xfi_OwnerGID;   /* group ID */
  218.   STRPTR           xfi_UserName;   /* user name */
  219.   STRPTR           xfi_GroupName;  /* group name */
  220.   ULONG                xfi_Size;       /* size of this file */
  221.   ULONG               xfi_GroupCrSize;/* crunched size of group */
  222.   ULONG               xfi_CrunchSize; /* crunched size */
  223.   STRPTR           xfi_LinkName;   /* name and path of link */
  224.   struct xadDate       xfi_Date;
  225. };
  226.  
  227. #define XADFIB_CRYPTED        0 /* entry is crypted */
  228. #define XADFIB_DIRECTORY    1 /* entry is a directory */
  229. #define XADFIB_LINK        2 /* entry is a link */
  230. #define XADFIB_INFOTEXT        3 /* file is an information text */
  231. #define XADFIB_GROUPED        4 /* file is in a crunch group */
  232. #define XADFIB_ENDOFGROUP    5 /* crunch group ends here */
  233.  
  234. #define XADFIF_CRYPTED        (1<<XADFIB_CRYPTED)
  235. #define XADFIF_DIRECTORY    (1<<XADFIB_DIRECTORY)
  236. #define XADFIF_LINK        (1<<XADFIB_LINK)
  237. #define XADFIF_INFOTEXT        (1<<XADFIB_INFOTEXT)
  238. #define XADFIF_GROUPED        (1<<XADFIB_GROUPED)
  239. #define XADFIF_ENDOFGROUP    (1<<XADFIB_ENDOFGROUP)
  240.  
  241. struct xadDiskInfo {
  242.   struct xadDiskInfo *  xdi_Next;
  243.   ULONG                xdi_EntryNumber;  /* number of entry, starts with 1 */
  244.   STRPTR            xdi_EntryInfo;    /* additional archiver text */
  245.   APTR                xdi_PrivateInfo;  /* client private, see XAD_OBJPRIVINFOSIZE */
  246.   ULONG            xdi_Flags;      /* see XADDIF_xxx defines */
  247.   ULONG                xdi_SectorSize;
  248.   ULONG            xdi_TotalSectors; /* see devices/trackdisk.h */
  249.   ULONG                xdi_Cylinders;      /* to find out what these */
  250.   ULONG                xdi_CylSectors;      /* fields mean, they are equal */
  251.   ULONG                xdi_Heads;      /* to struct DriveGeometry */
  252.   ULONG            xdi_TrackSectors;
  253.   ULONG                xdi_LowCyl;       /* lowest cylinder stored */
  254.   ULONG                xdi_HighCyl;      /* highest cylinder stored */
  255.   ULONG            xdi_BlockInfoSize;/* number of BlockInfo entries */
  256.   UBYTE *        xdi_BlockInfo;    /* see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag */
  257.   STRPTR        xdi_InfoText;
  258.   ULONG            xdi_InfoTextSize;
  259.   STRPTR        xdi_Banner;
  260.   ULONG            xdi_BannerSize;
  261. };
  262.  
  263. /* BlockInfo points to a UBYTE field for every track from first sector of
  264.    lowest cylinder to last sector of highest cylinder. When not used,
  265.    pointer must be 0. Do not use it, when there are no entries!
  266.    This is just for information. The applications still asks the client
  267.    to unarchive whole cylinders and not archived blocks are cleared for
  268.    unarchiving.
  269. */
  270.  
  271. #define XADDIB_CRYPTED          0 /* entry is crypted */
  272. #define XADDIB_INFOTEXT          1 /* description text was added */
  273. #define XADDIB_BANNER          2 /* information text was added (banner) */
  274.  
  275. /* Some of the crunchers do not store all necessary information, so it
  276. may be needed to guess some of them. Set the following flags in that case
  277. and geometry check will ignore these fields. */
  278. #define XADDIB_GUESSCYLINDERS      7 /* cylinder number is guessed */
  279. #define XADDIB_GUESSCYLSECTORS      8 /* cylsectors is guessed */
  280. #define XADDIB_GUESSHEADS      9 /* number of heads is guessed */
  281. #define XADDIB_GUESSTRACKSECTORS 10 /* tracksectors is guessed */
  282. #define XADDIB_GUESSLOWCYL     11 /* lowcyl is guessed */
  283. #define XADDIB_GUESSHIGHCYL     12 /* highcyl is guessed */
  284.  
  285. /* If it is impossible to set some of the fields, you not to set some of
  286. these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  287. of usage of lowcyl and highcyl keywords. When you have cylinder information,
  288. you should not use these and instead use guess flags and calculate
  289. possible values for the missing fields. */
  290. #define XADDIB_NOCYLINDERS     15 /* cylinder number is not set */
  291. #define XADDIB_NOCYLSECTORS     16 /* cylsectors is not set */
  292. #define XADDIB_NOHEADS          17 /* number of heads is not set */
  293. #define XADDIB_NOTRACKSECTORS    18 /* tracksectors is not set */
  294. #define XADDIB_NOLOWCYL          19 /* lowcyl is not set */
  295. #define XADDIB_NOHIGHCYL     20 /* highcyl is not set */
  296.  
  297. #define XADDIF_CRYPTED         (1<<XADDIB_CRYPTED)
  298. #define XADDIF_INFOTEXT         (1<<XADDIB_INFOTEXT)
  299. #define XADDIF_BANNER         (1<<XADDIB_BANNER)
  300.  
  301. #define XADDIF_GUESSCYLINDERS     (1<<XADDIB_GUESSCYLINDERS)
  302. #define XADDIF_GUESSCYLSECTORS     (1<<XADDIB_GUESSCYLSECTORS)
  303. #define XADDIF_GUESSHEADS     (1<<XADDIB_GUESSHEADS)
  304. #define XADDIF_GUESSTRACKSECTORS (1<<XADDIB_GUESSTRACKSECTORS)
  305. #define XADDIF_GUESSLOWCYL     (1<<XADDIB_GUESSLOWCYL)
  306. #define XADDIF_GUESSHIGHCYL     (1<<XADDIB_GUESSHIGHCYL)
  307.  
  308. #define XADDIF_NOCYLINDERS     (1<<XADDIB_NOCYLINDERS)
  309. #define XADDIF_NOCYLSECTORS     (1<<XADDIB_NOCYLSECTORS)
  310. #define XADDIF_NOHEADS         (1<<XADDIB_NOHEADS)
  311. #define XADDIF_NOTRACKSECTORS     (1<<XADDIB_NOTRACKSECTORS)
  312. #define XADDIF_NOLOWCYL         (1<<XADDIB_NOLOWCYL)
  313. #define XADDIF_NOHIGHCYL     (1<<XADDIB_NOHIGHCYL)
  314.  
  315. /* defines for BlockInfo */
  316. #define XADBIB_CLEARED        0 /* this block was cleared for archiving */
  317. #define XADBIB_UNUSED        1 /* this block was not archived */
  318.  
  319. #define XADBIF_CLEARED        (1<<XADBIB_CLEARED)
  320. #define XADBIF_UNUSED        (1<<XADBIB_UNUSED)
  321.  
  322. /************************************************************************
  323. *                                                *
  324. *    progress report stuff                              *
  325. *                                                *
  326. ************************************************************************/
  327.  
  328. struct xadProgressInfo {
  329.   ULONG            xpi_Mode;    /* work modus */
  330.   struct xadClient *    xpi_Client;    /* the client doing the work */
  331.   struct xadDiskInfo *    xpi_DiskInfo;    /* current diskinfo, for disks */
  332.   struct xadFileInfo *    xpi_FileInfo;    /* current info for files */
  333.   ULONG            xpi_CurrentSize;/* current filesize */
  334.   ULONG            xpi_LowCyl;    /* for disks only */
  335.   ULONG            xpi_HighCyl;    /* for disks only */
  336.   ULONG            xpi_Status;    /* see XADPIF flags */
  337.   LONG            xpi_Error;    /* any of the error codes */
  338. };
  339. /* NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  340. be found in xadDiskInfo structure. So you may output the sector value. */
  341.  
  342. /* different progress modes */
  343. #define XADPMODE_ASK        1
  344. #define XADPMODE_PROGRESS    2
  345. #define XADPMODE_END        3
  346. #define XADPMODE_ERROR        4
  347.  
  348. /* flags for progress hook and ProgressInfo status field */
  349. #define XADPIB_OVERWRITE     0 /* overwrite the file */
  350. #define XADPIB_MAKEDIRECTORY     1 /* create the directory */
  351. #define XADPIB_IGNOREGEOMETRY     2 /* ignore drive geometry */
  352. #define XADPIB_OK        16 /* all ok, proceed */
  353. #define XADPIB_SKIP        17 /* skip file */
  354.  
  355. #define XADPIF_OVERWRITE    (1<<XADPIB_OVERWRITE)
  356. #define XADPIF_MAKEDIRECTORY    (1<<XADPIB_MAKEDIRECTORY)
  357. #define XADPIF_IGNOREGEOMETRY    (1<<XADPIB_IGNOREGEOMETRY)
  358. #define XADPIF_OK        (1<<XADPIB_OK)
  359. #define XADPIF_SKIP        (1<<XADPIB_SKIP)
  360.  
  361. /************************************************************************
  362. *                                                *
  363. *    errors                                       *
  364. *                                                *
  365. ************************************************************************/
  366.  
  367. #define XADERR_OK        0x0000 /* no error */
  368. #define XADERR_UNKNOWN        0x0001 /* unknown error */
  369. #define XADERR_INPUT        0x0002 /* input data buffers border exceeded */
  370. #define XADERR_OUTPUT        0x0003 /* output data buffers border exceeded */
  371. #define XADERR_BADPARAMS    0x0004 /* function called with illegal parameters */
  372. #define XADERR_NOMEMORY        0x0005 /* not enough memory available */
  373. #define XADERR_ILLEGALDATA    0x0006 /* data is corrupted */
  374. #define XADERR_NOTSUPPORTED    0x0007 /* command is not supported */
  375. #define XADERR_RESOURCE        0x0008 /* required resource missing */
  376. #define XADERR_DECRUNCH        0x0009 /* error on decrunching */
  377. #define XADERR_FILETYPE        0x000A /* unknown file type */
  378. #define XADERR_OPENFILE        0x000B /* opening file failed */
  379. #define XADERR_SKIP        0x000C /* file, disk has been skipped */
  380. #define XADERR_BREAK        0x000D /* user break in progress hook */
  381. #define XADERR_FILEEXISTS    0x000E /* file already exists */
  382. #define XADERR_PASSWORD        0x000F /* missing or wrong password */
  383. #define XADERR_MAKEDIR        0x0010 /* could not create directory */
  384.  
  385. /************************************************************************
  386. *                                                *
  387. *    client related stuff                           *
  388. *                                                *
  389. ************************************************************************/
  390.  
  391. struct xadForeman {
  392.   ULONG             xfm_Security;    /* should be XADFOREMAN_SECURITY */
  393.   ULONG             xfm_ID;          /* must be XADFOREMAN_ID */
  394.   UWORD             xfm_Version;     /* set to XADFOREMAN_VERSION */
  395.   UWORD             xfm_Reserved;
  396.   STRPTR         xfm_VersString;  /* pointer to $VER: string */
  397.   struct xadClient * xfm_FirstClient; /* pointer to first client */
  398. };
  399.  
  400. #define XADFOREMAN_SECURITY    0x70FF4E75 /* MOVEQ #-1,D0 and RTS */
  401. #define XADFOREMAN_ID        0x58414446 /* 'XADF' identification ID */
  402. #define XADFOREMAN_VERSION    1
  403.  
  404. struct xadClient {
  405.   struct xadClient * xc_Next;
  406.   UWORD             xc_Version;    /* set to XADCLIENT_VERSION */
  407.   UWORD             xc_MasterVersion;
  408.   UWORD             xc_ClientVersion;
  409.   UWORD             xc_ClientRevision;
  410.   ULONG             xc_RecogSize;  /* needed size to recog the type */
  411.   ULONG             xc_Flags;      /* see XADCF_xxx defines */
  412.   ULONG             xc_Identifier; /* ID of internal clients */
  413.   STRPTR         xc_ArchiverName;
  414.   BOOL          (* xc_RecogData)();
  415.   LONG          (* xc_GetInfo)();
  416.   LONG          (* xc_UnArchive)();
  417.   void          (* xc_Free)();
  418. };
  419.  
  420. /* xc_RecogData returns 1 when recognized and 0 when not, all the others
  421.    return 0 when ok and XADERR values on error. xc_FinishUnArc has no
  422.    return value. */
  423.  
  424. /* function interface
  425. ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  426.         REG(a6, struct xadMasterBase *xadMasterBase));
  427. ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  428.         REG(a6, struct xadMasterBase *xadMasterBase));
  429. ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  430.         REG(a6, struct xadMasterBase *xadMasterBase));
  431. ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  432.         REG(a6, struct xadMasterBase *xadMasterBase));
  433. */
  434.  
  435. #define XADCLIENT_VERSION    1
  436.  
  437. #define XADCB_FILEARCHIVER    0 /* archiver is a file archiver */
  438. #define XADCB_DISKARCHIVER    1 /* archiver is a disk archiver */
  439. #define XADCB_EXTERN        2 /* external client, set by xadmaster */
  440.  
  441. #define XADCF_FILEARCHIVER    (1<<XADCB_FILEARCHIVER)
  442. #define XADCF_DISKARCHIVER    (1<<XADCB_DISKARCHIVER)
  443. #define XADCF_EXTERN        (1<<XADCB_EXTERN)
  444.  
  445. /************************************************************************
  446. *                                                *
  447. *    client ID's                                   *
  448. *                                                *
  449. ************************************************************************/
  450.  
  451. /* If an external client has set the xc_Identifier field, the internal
  452. client is replaced. */
  453.  
  454. /* disk archivers start with 1000 */
  455. #define XADCID_XMASH            1000
  456. #define XADCID_SUPERDUPER3        1001
  457. #define XADCID_XDISK            1002
  458.  
  459. /* file archivers start with 5000 */
  460. #define XADCID_TAR            5000
  461.  
  462. #endif /* LIBRARIES_XADMASTER_H */
  463.